package com.wy17113.model.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.wy17113.model.dao.IUserDao;
import com.wy17113.model.entity.ScoreRecord;
import com.wy17113.model.entity.User;
import com.wy17113.model.service.IUserService;

public class UserServiceImpl implements IUserService {
	 private IUserDao userdao;

	/////////////////////////////////////////////////
	 
	public IUserDao getUserdao() {
		return userdao;
	}

	public void setUserdao(IUserDao userdao) {
		this.userdao = userdao;
	}

	public User userLogin(String account, String password) {		
		return userdao.userLogin(account, password);
	}

	public int getUserScoresById(String id) {
		return userdao.getUserScoresById(id);
	}

	public void checkQianDao(ScoreRecord sr) {
		userdao.checkQianDao(sr);
	}

	public int checkUserIsQianDao(String id, String date) {
		return userdao.checkUserIsQianDao(id, date);
	}

	public int getUserinviteNum(String id) {
		return userdao.getUserinviteNum(id);
	}

	public void saveUser(User user) {
		userdao.saveUser(user);
	}

	public int checkIsOneIpRegist(String fromId, String ip) {
		return userdao.checkIsOneIpRegist(fromId, ip);
	}

	public int checkAccountExist(String account) {
		return userdao.checkAccountExist(account);
	}

	public List<User> getAllUser(String uid,String account,int flag,String startTime,String endTime, int start, int count) {
		return userdao.getAllUser(uid,account,flag,startTime,endTime, start, count);
	}

	public int getAllUserCounts(String uid,String account,int flag,String startTime,String endTime) {
		return userdao.getAllUserCounts(uid,account,flag,startTime,endTime);
	}

	public void delete(int flag,String id) throws SQLException {
		userdao.delete(flag,id);
	}

}
